

///////////////////////////////////////////////////////////////////////////////////////////////////
////////////// Table 3 - Attorney Ideology and Diectionality of Court Decisions ///////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////



*** Load Data
use Data_OPO_Master, clear

* Supreme Court
tab USCDB_decisionDirection
gen ddirection_sc =. 
replace ddirection_sc = 1 if USCDB_decisionDirection==1
replace ddirection_sc = 0 if USCDB_decisionDirection==2

gen winning_cf = . 
replace winning_cf = sc_pet_atty_cf if USCDB_partyWinning==1
replace winning_cf = sc_resp_atty_cf if USCDB_partyWinning==0

gen losing_cf = . 
replace losing_cf = sc_pet_atty_cf if USCDB_partyWinning==0
replace losing_cf = sc_resp_atty_cf if USCDB_partyWinning==1

* Lower Court
tab USCDB_lcDispositionDirection
gen ddirection_lc =. 
replace ddirection_lc = 1 if USCDB_lcDispositionDirection==1
replace ddirection_lc = 0 if USCDB_lcDispositionDirection==2

gen winning_cf2 = . 
replace winning_cf2 = sc_resp_atty_cf 

gen losing_cf2 = . 
replace losing_cf2 = sc_pet_atty_cf 

*** Supreme Court Decisions
reg ddirection_sc winning_cf losing_cf 
outreg2 winning_cf losing_cf using "Table3.tex", nocons replace tex dec(3) drop(i.sc_term i.coa_circuit)

reg ddirection_sc winning_cf losing_cf i.sc_term i.coa_circuit 
outreg2 winning_cf losing_cf  using "Table3.tex", nocons append tex dec(3) drop(i.sc_term i.coa_circuit)

*** Lower Court Decisions
reg ddirection_lc winning_cf2 losing_cf2
outreg2 winning_cf2 losing_cf2  using "Table3.tex", nocons append tex dec(3) drop(i.sc_term i.coa_circuit)

reg ddirection_lc winning_cf2 losing_cf2 i.sc_term i.coa_circuit 
outreg2 winning_cf2  losing_cf2 using "Table3.tex", nocons append tex dec(3) drop(i.sc_term i.coa_circuit)

// Marginal Effects

summarize winning_cf,detail
reg ddirection_sc winning_cf losing_cf i.sc_term i.coa_circuit 
margins, at(winning_cf=(-1.123978  .9614566 ))
di .6730006   -  .4653293 

summarize winning_cf2,detail
reg ddirection_lc winning_cf2 losing_cf2 i.sc_term i.coa_circuit 
margins, at(winning_cf=( -.9590418     1.114044 ))
di .5898429   -.4429456
